Hi,
I’m looking for a solution to get or export object’s motion datas from the keyshot animation.
I have animated an exploded view but on parts orientation, which are not aligned with world axis, and with custom curve timing, then on After Effect, I need to accuratly track those parts.
I’ve already made a script to get camera’s motion datas for AE but KS doesn’t apply animation on the object transform datas.
Does someone have a clue on how to get those informations ?
Thanks.
1 Like
Hi Pierre,
Sounds pretty complicated and outside my knowledge. You can’t use trackers on the animation itself like you would do as well when the source is just ‘normal’ video?
Maybe @don.tuttle can help you out here.
1 Like
Yeah that would def be a scripting thing, there is nothing in the UI that would provide that information. And the problem is that there AE would need the 3d World Coordinates, read those, and place in the AE comp properly ignoring the camera stuff, then AE’s camera would take over for framing everything. I think the best way to achieve this would be to have 2 renders, one normal output from KS, then you would place colored cubes in the KS groups that you wanted to track the movement of, turn everything else off and render a “clown pass” of sorts with just the tracking cubes on. layer that in AE and use AE’s tracking abilities on those cubes. Depending on what you want to do in the end, it would get you close. Otherwise, yeah, you might be outside of KS’s ability.
Hey Pierre,
You have to get the Bounding box of the animation nodes. See snippet below.
@oscar.rottink Thanks for the heads up!
def get_animated_bounding_box_at_current_frame(animation_nodes, current_frame):
"""
Retrieves world-space bounding boxes of all animated parent nodes.
"""
bounding_boxes = []
for anim_node in animation_nodes:
print(f"\nProcessing Node: {anim_node.getName()}")
model_node = anim_node.getParent()
if not model_node:
print(f"⚠️ No parent found for '{anim_node.getName()}'")
continue
bounding_box = model_node.getBoundingBox(world=False)
if not bounding_box:
print(f"⚠️ Bounding box not available for '{model_node.getName()}'")
continue
bbox_min, bbox_max = bounding_box
transform_matrix = model_node.getTransform(world=True)
scale, rotation, translation = transform_matrix.getTransformation()
bbox_min_world = luxmath.Vector(
bbox_min.x + translation.x,
bbox_min.y + translation.y,
bbox_min.z + translation.z
)
bbox_max_world = luxmath.Vector(
bbox_max.x + translation.x,
bbox_max.y + translation.y,
bbox_max.z + translation.z
)
print(f"📦 '{model_node.getName()}' @ Frame {current_frame}")
print(f" Min: {bbox_min_world}")
print(f" Max: {bbox_max_world}")
bounding_boxes.append((model_node.getName(), bbox_min_world, bbox_max_world))
return bounding_boxes
1 Like
Hi Don
Thanks for your answer. I would explore that script later as I found a workaround sooner.
I’ve exported OBJ files from KS at important keyframes. OBJ export applies animation like a screenshot. Then, import inside blender, update origins and some grouping, rebuild the animation by snaping the mesh and finaly build a csv from Blender.
Best
1 Like
Pierre,
Glad you found a workaround. I came back to mention that we can’t extract the rotation of an animation via scripting. 